/**
*********************************************************************************
 *(C) @@.        [hx] All Rights Reserved.
 *FileName:      utility.h
 *Author:        fly
 *Telephtone:    
 *Version:       1.0.0
 *Data:          2021.01.04
 *Description:   
 *Others:        
 *History:       
**********************************************************************************
*/

#ifndef _SERIAL_UTILITY_H
#define _SERIAL_UTILITY_H

#ifdef __cplusplus
extern "C" {
#endif

#include <stdio.h>
#include <string.h>

#ifndef bool
typedef unsigned char bool;
#endif

#ifndef boolean
typedef unsigned char boolean;
#endif

#ifndef true
#define true (1)
#endif

#ifndef false
#define false (0)
#endif

#ifndef error
#define error (-1)
#endif

#ifndef U8
typedef unsigned char U8;
#endif

#ifndef U16
typedef unsigned short int U16;
#endif

#ifndef U32
typedef unsigned int U32;
#endif

#ifndef U32
typedef unsigned int U32;
#endif

#ifndef S8
typedef signed char S8;
#endif

#ifndef S16
typedef signed short int S16;
#endif

#ifndef S32
typedef signed int S32;
#endif

#ifndef MAX
#define MAX(a,b) ((a) > (b) ? (a) : (b))
#endif

#ifndef MIN
#define MIN(a,b) ((a) < (b) ? (a) : (b))
#endif
#ifdef __cplusplus
}
#endif

#endif //_SERIAL_UTILITY_H